<template>
    <div>
        <van-tabs v-model:active="active">
            <van-tab title="精选 1">
                <van-swipe :autoplay="3000" lazy-render>
                    <van-swipe-item v-for="image in images" :key="image">
                        <img :src="image" style="width: 350px;height: 200px;" />
                    </van-swipe-item>
                </van-swipe>
            </van-tab>
            <van-tab title="本地 2">内容 2</van-tab>
            <van-tab title="新车 3">内容 3</van-tab>
            <van-tab title="原创 4">内容 4</van-tab>
            <van-tab title="视频看车 4">内容 4</van-tab>
            <van-tab title="导购 4">内容 4</van-tab>
        </van-tabs>
        <van-tabbar route>
            <van-tabbar-item replace to="/home/index" icon="home-o">标签</van-tabbar-item>
            <van-tabbar-item replace to="/home/cla" icon="home-o">标签</van-tabbar-item>
            <van-tabbar-item replace to="/home/cart" icon="home-o">标签</van-tabbar-item>
            <van-tabbar-item replace to="/home/my" icon="search">标签</van-tabbar-item>
            <van-tabbar-item replace to="/home/my" icon="search">标签</van-tabbar-item>
        </van-tabbar>
         <van-grid >
            <van-grid-item v-for="item in catitems" :icon="item.image_src"  />
        </van-grid>
        <img src="../img/1.png" alt="">
        <p>华为比亚迪互卷,受伤的是17万的宝马?</p>
        <img src="../img/image.png" alt="">
    </div>
</template>

<script setup>
const images = [
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
];
import { catitemsApi } from '@/api/api';
import { ref } from 'vue';
let catitems=ref([])
catitemsApi().then(res => {
    console.log('导航', res);
    catitems.value=res.data.message
})
</script>

<style>
img{
    width: 350px;
}
</style>